﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace EFCore.Models;

[Table("MaterialBase")]
public partial class MaterialBase
{
    [Key]
    [Column("Id_Materialbase")]
    public Guid IdMaterialbase { get; set; }

    public DateTime CreatedDate { get; set; }

    /// <summary>
    /// 物料号
    /// </summary>
    public string MaterialName { get; set; } = null!;

    /// <summary>
    /// Lpn
    /// </summary>
    public string MaterialCode { get; set; } = null!;

    /// <summary>
    /// 1个单位物料数量
    /// </summary>
    public int? Quantity { get; set; }

    /// <summary>
    /// 是否删除
    /// </summary>
    public bool? IsDelete { get; set; }

    public Guid MaterialPropertyMaterialProertyid { get; set; }

    [Column("Id_BoxGrid")]
    public Guid? IdBoxGrid { get; set; }

    [ForeignKey("IdBoxGrid")]
    [InverseProperty("MaterialBases")]
    public virtual BoxGrid? IdBoxGr { get; set; }

    [ForeignKey("MaterialPropertyMaterialProertyid")]
    [InverseProperty("MaterialBases")]
    public virtual MaterialProperty MaterialPropertyMaterialProerty { get; set; } = null!;

    [InverseProperty("MaterialIdMaterialbaseNavigation")]
    public virtual ICollection<NeetOutMaterial> NeetOutMaterials { get; set; } = new List<NeetOutMaterial>();

    [ForeignKey("MaterialBasesIdMaterialbase")]
    [InverseProperty("MaterialBasesIdMaterialbases")]
    public virtual ICollection<MaterialOrder> MaterialOrdersIdMaterialOders { get; set; } = new List<MaterialOrder>();
}
